home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
FifoScheduler.cc,v
< prev
next >
Wrap
Text File
|
1989-02-21
|
2KB
|
126 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @@;
3.2
date 89.02.20.15.34.33; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.48.44; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.10.30.13.04.26; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.18.16.42.20; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#include "Thread.h"
#include "FifoScheduler.h"
#include "stream.h"
#include "assert.h"
FifoScheduler::FifoScheduler(int defaultLength, bool xdebug)
: (xdebug), fifo(defaultLength)
{
fifo.reSize(defaultLength);
}
void
FifoScheduler::add(Thread *t)
{
fifo.add(&t);
}
void
FifoScheduler::add(double , Thread *)
{
assert2(FALSE, "[FifoScheduler] add(when, thread) not provided");
}
Thread *
FifoScheduler::remove()
{
AwesimeFifoItem item;
bool removed = fifo.remove(&item);
assert2( removed, " Attempted to remove non-existent item");
return( (Thread *) item);
}
Thread *
FifoScheduler::remove(Thread *t)
{
AwesimeFifoItem item = (AwesimeFifoItem) t;
bool removed = fifo.remove(&item);
assert2( removed, " Attempted to remove non-existent item");
return(t);
}
bool FifoScheduler::isEmpty()
{
return(fifo.isEmpty());
}
unsigned int FifoScheduler::size()
{
return(fifo.size());
}
void FifoScheduler::classPrintOn(ostream& s)
{
s << "[FifoScheduler] " << fifo;
}
@
3.1
log
@Steay version
@
text
@@
1.2
log
@*** empty log message ***
@
text
@@
1.1
log
@Initial revision
@
text
@d1 6
@